import { request } from "../utils/request";

const api = {
  getProductInfo: '/wx/user/product/info',
  getCategoryAllData: '/wx/user/product/type',
  getProductCategory: '/wx/user/product/category',
  getProductInfoById: '/wx/user/product/info-id'

}


// 主页获取全部商品信息
export const getProductInfo = () => {
  return request({
    url: api.getProductInfo,
    method: 'GET'
  })
}

// 获取全部分类信息
export const getCategoryAllData = () => {
  return request({
    url: api.getCategoryAllData,
    method: 'GET'
  })
}

// 分类获取商品信息
export const getProductCategory = (param) => {
  return request({
    url: api.getProductCategory,
    method: 'GET',
    data: param
  })
}

export const getProductInfoById = (param) =>{
  return request({
    url: api.getProductInfoById,
    method: 'GET',
    data: param
  })
}